<?php
include_once '../data/database_dal.php';

class CompanyProfileDAL extends DatabaseDAL
{
    function update($id, $active, $membership, $categoryID, $marketID, $process, $address1, $address2, $address3,
                     $address4, $supplierID, $inTime, $inUser)
    {
        $this->connect();
        $result = $mysqli->query("call pr_company_profile_update('". $id ."', '". $active ."', '". $membership ."', '". $categoryID ."',
                                  '". $marketID ."', '". $process ."', '". $address1 ."', '". $address2 ."', '". $address3 ."', '". $address4 ."',
                                  '". $supplierID ."', '". $inTime ."', '". $inUser ."',)");
        $this->close();
        return $result;
    }

    function get($where)
    {
        $this->connect();
        return $this->mysqli->query("call pr_user_get(".'"'.$where.'"'.")");
        $this->close();
        return $result;
    }

    function getAll($orderBy)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_user_get(".'"'.$orderBy.'"'.")");
        $this->close();
        return $result;
    }

    function delete($mysqli, $id)
    {
        $result = $mysqli->query("call pr_company_profile_delete('". $id ."')");
        if ($result != 1) {
            return false;
        } else {
            return true;
        }
    }
}
?>